package main

import (
	"fmt"
	"webProject/crawler/engine"
	"webProject/crawler/scheduler"
)

func findType(i interface{}) {
	switch x :=     i.(type) {
	case int:
		fmt.Println(x, "is int")
	case string:
		fmt.Println(x, "is string")
	case nil:
		fmt.Println(x, "is nil")
	default:
		fmt.Println(x, "not type matched")
	}
}

//func main() {
//	findType(10) // int
//	findType("hello") // string
//
//	var k interface{} // nil
//	findType(k)
//
//	findType(10.23) //float64
//}
func main(){
	currentEngine := engine.CurrentEngine{
		Scheduler:   &scheduler.QueueScheduler{},
		WorkerCount: 1,
		Processor:   engine.Worker,
	}
	currentEngine.Run()
}



func removeDuplicates(nums []int) int {
	if len(nums)==0 {
		return 0
	}
	pre := nums[0]
	index:= 1
	for i:=1;i< len(nums);i++ {
		if pre==nums[i] {
			continue
		}else {
			nums[index]=nums[i]
			pre = nums[index]
			index++
		}
	}
	return index
}


func rotate(nums []int, k int)  {

	i := k
	for i!=0 {

	}
}
